package com.example.demo.javatest.thread.tongxin;


/**
 * Created by liujiahao on 2019/3/13.
 */
public class Service {
    public void testMethod(Object lock){
        synchronized (lock){
            System.out.println("begin wait() ThreadName="+Thread.currentThread().getName());
            try {
                lock.wait();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("end wait() ThreadName="+Thread.currentThread().getName());
        }
    }
}
